package java67_14.vip;

import java.util.Scanner;

public class MaTest {

	public static void main(String[] args) {
		SuperMarket sp = new SuperMarket();
		sp.name = "家乐福马鞍山路店";
		Scanner in = new Scanner(System.in);
		int ch = 0;
		while (true) {
			System.out.println("1:新增会员  2:查看会员信息  3:查看会员积分  9:退出");
			ch = in.nextInt();
			if (ch == 1) {
				System.out.print("请分别输入卡号和积分:");
				Vip v = new Vip();
				v.no = in.next();
				v.score = in.nextInt();
				boolean ok = sp.add(v);
				System.out.println(ok ? "增加成功" : "增加失败");
			} else if (ch == 2) {
				sp.showVipsInformation();
			} else if (ch == 3) {
				System.out.print("请输入卡号:");
				String cardNo = in.next();
				Vip v = sp.find(cardNo);
				if (v == null) {
					System.out.println("没有此会员");
				} else {
					System.out.println("此会员积分是:" + v.score);
				}
			} else if (ch == 9) {
				break;
			}
		}
	}

}
